package exmpcase;

public class Test3 {
    public static void main(String[] args) {
        Integer num = Integer.valueOf("01111011",2);
        System.out.println(num);
        System.out.println(binarySystem(123));
    }
    public static String binarySystem(int num){
        StringBuilder str = new StringBuilder();
        while (true){
            str.append(num%2);
            if (num == 0){
                break;
            }
            num=num/2;
        }
        return str.reverse().toString();
    }
}
